package com.cong.project.model.enums;


/**
 * 商店状态枚举
 * @author lhcong
 *
 */

public enum MerchantStatus {
    /**
     * 商店状态
     */
    PUBLIC(0,"休息"),
    PRIVATE(1,"营业"),
    SECRET(-1,"下架")
    ;

    private int value;

    private String text;

    public static MerchantStatus geEnumByValue(Integer value){
        if (value==null){
            return null;
        }
        MerchantStatus[] values = MerchantStatus.values();
        for (MerchantStatus merchantStatus : values) {
            if (merchantStatus.getValue() ==value){
                return merchantStatus;
            }
        }
        return null;
    }

    MerchantStatus(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
